package com.trkj.property_controller;

import com.trkj.entity.FeiYongEntity;
import com.trkj.entity.FeiYongEntity;
import com.trkj.entity.HouseEntity;
import com.trkj.service.FeiYongService;
import com.trkj.vo.AjaxResponse;
import org.springframework.web.bind.annotation.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@Slf4j
@RequestMapping("/FeiYong")
public class FeiYongController {

    @Resource
    private FeiYongService feiYongService;

    @PostMapping("selectFeiYongAll")
    public AjaxResponse selectFeiYongAll(@RequestBody FeiYongEntity feiYongEntity, @RequestParam("currentPage")int currentPage, @RequestParam("pageSize")int pageSize){
        return AjaxResponse.success(feiYongService.selectFeiYongAll(feiYongEntity,currentPage, pageSize));
    }

    @PostMapping("addbillingltems")
    public AjaxResponse addbillingltems(@RequestBody FeiYongEntity feiYongEntity) {
        return AjaxResponse.success(feiYongService.addbillingltems(feiYongEntity));
    }
    @PostMapping("/selectAllFeiYong")
    public AjaxResponse selectAll(@RequestBody FeiYongEntity feiYongEntity, @RequestParam("currentPage")int currentPage, @RequestParam("pageSize")int pageSize) {
        log.info("{}",feiYongEntity);
        return AjaxResponse.success(feiYongService.selectAll(feiYongEntity,currentPage, pageSize));
    }

    @GetMapping("selectname")
    public AjaxResponse selectname(){
        return AjaxResponse.success(feiYongService.selectname());
    }


    @PostMapping("addFeiYong")
    public AjaxResponse addFeiYong(@RequestBody FeiYongEntity feiYongEntity){
        return AjaxResponse.success(feiYongService.addFeiYong(feiYongEntity));
    }

    @PostMapping("addfwfyconnect")
    public AjaxResponse addfwfyconnect(@RequestBody FeiYongEntity feiYongEntity){
        return AjaxResponse.success(feiYongService.addfwfyconnect(feiYongEntity));
    }

    @GetMapping("/selectmax")
    public AjaxResponse selectmax(){
        return AjaxResponse.success(feiYongService.selectmax());
    }


}
